bitkeeper revision 1.1490 (428e17e3-aTEgwH1KsJrUT4WjK5zWQ)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 20 May 2005 17:01:23 +0000 (17:01 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 20 May 2005 17:01:23 +0000 (17:01 +0000)
Fix ioemu build.
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/Makefile
tools/ioemu/target-i386-dm/helper2.c

index 52ddb9f24be3143f1b3a1a8afc97287ec7908868..64778a91469ac3a166f7065ee39b3ef664f5917b 100644 (file)
@@ -38,6 +38,10 @@ check:
 check_clean:
        $(MAKE) -C check clean
 
+ifneq ($(XEN_TARGET_ARCH),x86_32)
+XEN_NO_IOEMU=1
+endif
+
 ifndef XEN_NO_IOEMU
 ioemu ioemuinstall ioemuclean:
        [ -f ioemu/config-host.h ] || \
index 3704b08361bd11f6b54db38b5abbff80cdb37542..ae8b763ea2a5450c3a398331b6b79565a2192b5c 100644 (file)
 #include "cpu.h"
 #include "exec-all.h"
 
-//#define DEBUG_MMU
-
-#ifdef USE_CODE_COPY
-#include <asm/ldt.h>
-#include <linux/unistd.h>
-#include <linux/version.h>
-
-#include <sys/ioctl.h>
-/* According to POSIX 1003.1-2001 */
-#include <sys/select.h>
-
-/* According to earlier standards */
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <values.h>
-
-_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount)
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66)
-#define modify_ldt_ldt_s user_desc
-#endif
-#endif /* USE_CODE_COPY */
-
 void *shared_page;
 
 CPUX86State *cpu_86_init(void)
@@ -321,7 +295,13 @@ cpu_timer_handler(CPUState *env)
 
 int xc_handle;
 
-#include <asm/bitops.h>
+static __inline__ void atomic_set_bit(long nr, volatile void *addr)
+{
+        __asm__ __volatile__(
+                "lock ; bts %1,%0"
+                :"=m" (*(volatile long *)addr)
+                :"dIr" (nr));
+}
 
 void
 do_interrupt(CPUState *env, int vector)
@@ -332,7 +312,7 @@ do_interrupt(CPUState *env, int vector)
        // page.
 
        intr = &(((vcpu_iodata_t *) shared_page)->vp_intr[0]);
-       set_bit(vector, intr);
+       atomic_set_bit(vector, intr);
         fprintf(logfile, "injecting vector: %x\n", vector);
        env->send_event = 1;
 }